#include<iostream>

class Matrix
{
private:
    int array[2][3];
public:
    Matrix() {}
    Matrix(int a1,int a2,int a3,int a4,int a5,int a6)  
    {
        array[0][0]=a1;array[0][1]=a2;array[0][2]=a3;
        array[1][0]=a4;array[1][1]=a5;array[1][2]=a6;
    }
    friend Matrix operator + (const Matrix& matrix1,const Matrix& matrix2);
    void Print()
    {
        std::cout<<'['<<std::endl;
        for(int i=0;i<2;i++)
        {
            
            for(int j=0;j<3;j++)
                std::cout<<array[i][j]<<'\t';
            std::cout<<std::endl;                
        }
        std::cout<<'\t'<<'\t'<<']'<<std::endl;
           
        
    }
};

Matrix operator + (const Matrix& matrix1,const Matrix& matrix2)
{
    return Matrix(matrix1.array[0][0]+matrix2.array[0][0],matrix1.array[0][1]+matrix2.array[0][1],matrix1.array[0][2]+matrix2.array[0][2],matrix1.array[1][0]+matrix2.array[1][0],matrix1.array[1][1]+matrix2.array[1][1],matrix1.array[1][2]+matrix2.array[1][2]);
}

int main()
{
    Matrix matrix1(1,2,3,4,5,6),matrix2(2,3,4,5,6,7);
    Matrix matrix3=matrix1+matrix2;
    matrix1.Print();
    matrix2.Print();
    matrix3.Print();
    return 0;
}